package com.frank.leftJoinQuery.controller;

import com.frank.leftJoinQuery.domain.StudentRequest;
import com.frank.leftJoinQuery.entity.Student;
import com.frank.leftJoinQuery.entity.Teacher;
import com.frank.leftJoinQuery.service.LeftJoinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 小石潭记
 * @date 2020/12/12 19:02
 * @Description: ${todo}
 */
@RestController
public class LeftJoinController {

    @Autowired
    private LeftJoinService leftJoinService;

    @GetMapping("/student1")
    public Page<Student> getStudent(StudentRequest request) {
        return leftJoinService.getStudentList(request);
    }

    @GetMapping("/teacher1")
    public Page<Teacher> getTeacher(StudentRequest request) {
        return leftJoinService.getTeacherList(request);
    }


}
